home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / f2c-stab.9 / f2c-stab / f2c-stabs / fts-f-strip-cmts < prev    next >
Encoding:
AWK Script  |  1996-02-11  |  1.3 KB  |  56 lines

  1. #!/usr/bin/awk -f
  2. # -*- awk -*-
  3. #
  4. # $Header: /usr/bfr/src/test/RCS/fts-f-strip-cmts,v 1.1 1995/01/18 17:39:14 abel Exp $
  5. #
  6. #********************************************
  7. #
  8. # remove FORTRAN comments
  9. #
  10. #********************************************
  11. #
  12. # Written by Alexander L. Belikoff, 1994
  13. # Copyright (C)1994 Alexander L. Belikoff
  14. #
  15. # This program is free software; you can redistribute it and/or modify
  16. # it under the terms of the GNU General Public License as published by
  17. # the Free Software Foundation; either version 2 of the License, or
  18. # (at your option) any later version.
  19. #
  20. # This program is distributed in the hope that it will be useful,
  21. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23. # GNU General Public License for more details.
  24. #
  25. #********************************************
  26. #
  27. # $Log: fts-f-strip-cmts,v $
  28. # Revision 1.1  1995/01/18  17:39:14  abel
  29. # Initial revision
  30. #
  31. #
  32. #********************************************
  33.  
  34.  
  35. # strip all FORTRAN comments end empty lines
  36.  
  37.  
  38. # skip all full-line comments
  39.  
  40. $0 ~ /^[^0-9 ]/ || $0 ~ /^[ \t]*$/ {
  41.     next
  42. }
  43.  
  44.  
  45. # now handle all the cases with '!': either ... ! ... or '...' ... ! ...
  46.  
  47. $0 ~ /!/ && $0 !~ /^[^\']*\'[^\']*!/ {
  48.    split($f, line, "!") 
  49.    $0 = line[1]
  50. }
  51.  
  52.  
  53. { print }
  54.  
  55. # end of $Source: /usr/bfr/src/test/RCS/fts-f-strip-cmts,v $
  56.